home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-06 | 19.4 KB | 580 lines | [ttro/ttxt] |
- 5.7. Phrase Markup
-
- Phrases may be marked up according to idiomatic usage, typographic
- appearance, or for use as hyperlink anchors.
-
- User agents must render highlighted phrases distinctly from plain
- text. Additionally, <EM> content must be rendered as distinct from
- <STRONG> content, and <B> content must rendered as distinct from <I>
- content.
-
- Phrase elements may be nested within the content of other phrase
- elements; however, HTML user agents may render nested phrase elements
-
- indistinctly from non-nested elements:
-
- plain <B>bold <I>italic</I></B> may be rendered
- the same as plain <B>bold </B><I>italic</I>
-
- 5.7.1. Idiomatic Elements
-
- Phrases may be marked up to indicate certain idioms.
-
- NOTE - User agents may support the <DFN> element, not included in
- this specification, as it has been deployed to some extent. It is
- used to indicate the defining instance of a term, and it is
- typically rendered in italic or bold italic.
-
- 5.7.1.1. Citation: CITE
-
- The <CITE> element is used to indicate the title of a book or
- other citation. It is typically rendered as italics. For example:
-
- He just couldn't get enough of <cite>The Grapes of Wrath</cite>.
-
- 5.7.1.2. Code: CODE
-
- The <CODE> element indicates an example of code, typically
- rendered in a mono-spaced font. The <CODE> element is intended for
- short words or phrases of code; the <PRE> block structuring
- element (5.5.2, "Preformatted Text: PRE") is more appropriate
- for multiple-line listings. For example:
-
- The expression <code>x += 1</code>
- is short for <code>x = x + 1</code>.
-
- 5.7.1.3. Emphasis: EM
-
- The <EM> element indicates an emphasized phrase, typically
- rendered as italics. For example:
-
- A singular subject <em>always</em> takes a singular verb.
-
- 5.7.1.4. Keyboard: KBD
-
- The <KBD> element indicates text typed by a user, typically
- rendered in a mono-spaced font. This is commonly used in
- instruction manuals. For example:
-
- Enter <kbd>FIND IT</kbd> to search the database.
-
- 5.7.1.5. Sample: SAMP
-
- The <SAMP> element indicates a sequence of literal characters,
- typically rendered in a mono-spaced font. For example:
-
- The only word containing the letters <samp>mt</samp> is dreamt.
-
- 5.7.1.6. Strong Emphasis: STRONG
-
- The <STRONG> element indicates strong emphasis, typically rendered
- in bold. For example:
-
- <strong>STOP</strong>, or I'll say "<strong>STOP</strong>" again!
-
- 5.7.1.7. Variable: VAR
-
- The <VAR> element indicates a placeholder variable, typically
- rendered as italic. For example:
-
- Type <SAMP>html-check <VAR>file</VAR> | more</SAMP>
- to check <VAR>file</VAR> for markup errors.
-
- 5.7.2. Typographic Elements
-
- Typographic elements are used to specify the format of marked
- text.
-
- Typical renderings for idiomatic elements may vary between user
- agents. If a specific rendering is necessary -- for example, when
- referring to a specific text attribute as in "The italic parts are
- mandatory" -- a typographic element can be used to ensure that the
- intended typography is used where possible.
-
- NOTE - User agents may support some typographic elements not
- included in this specification, as they have been deployed to some
- extent. The <STRIKE> element indicates horizontal line through the
- characters, and the <U> element indicates an underline.
-
- 5.7.2.1. Bold: B
-
- The <B> element indicates bold text. Where bold typography is
- unavailable, an alternative representation may be used.
-
- 5.7.2.2. Italic: I
-
- The <I> element indicates italic text. Where italic typography is
- unavailable, an alternative representation may be used.
-
-
- 5.7.2.3. Teletype: TT
-
- The <TT> element indicates teletype (monospaced )text. Where a
- teletype font is unavailable, an alternative representation may be
- used.
-
- 5.7.3. Anchor: A
-
- The <A> element indicates a hyperlink anchor (see 7, "Hyperlinks").
- At least one of the NAME and HREF attributes should be present.
- Attributes of the <A> element:
-
- HREF
- gives the URI of the head anchor of a hyperlink.
-
- NAME
- gives the name of the anchor, and makes it available as
- a head of a hyperlink.
-
- TITLE
- suggests a title for the destination resource --
- advisory only. The TITLE attribute may be used:
-
- * for display prior to accessing the destination
- resource, for example, as a margin note or on a
- small box while the mouse is over the anchor, or
- while the document is being loaded;
-
- * for resources that do not include a title, such as
- graphics, plain text and Gopher menus, for use as a
- window title.
-
- REL
- The REL attribute gives the relationship(s) described by
- the hyperlink. The value is a whitespace separated list
- of relationship names. The semantics of link
- relationships are not specified in this document.
-
- REV
- same as the REL attribute, but the semantics of the
- relationship are in the reverse direction. A link from A
- to B with REL="X" expresses the same relationship as a
- link from B to A with REV="X". An anchor may have both
- REL and REV attributes.
-
- URN
- specifies a preferred, more persistent identifier for
- the head anchor of the hyperlink. The syntax and
-
- semantics of the URN attribute are not yet specified.
-
- METHODS
- specifies methods to be used in accessing the
- destination, as a whitespace-separated list of names.
- The set of applicable names is a function of the scheme
- of the URI in the HREF attribute. For similar reasons as
- for the TITLE attribute, it may be useful to include the
- information in advance in the link. For example, the
- HTML user agent may chose a different rendering as a
- function of the methods allowed; for example, something
- that is searchable may get a different icon.
-
- 5.8. Line Break: BR
-
- The <BR> element specifies a line break between words (see 6,
- "Characters, Words, and Paragraphs"). For example:
-
- <P> Pease porridge hot<BR>
- Pease porridge cold<BR>
- Pease porridge in the pot<BR>
- Nine days old.
-
- 5.9. Horizontal Rule: HR
-
- The <HR> element is a divider between sections of text; typically a
- full width horizontal rule or equivalent graphic. For example:
-
- <HR>
- <ADDRESS>February 8, 1995, CERN</ADDRESS>
- </BODY>
-
- 5.10. Image: IMG
-
- The <IMG> element refers to an image or icon via a hyperlink (see
- 7.3, "Simultaneous Presentation of Image Resources").
-
- HTML user agents may process the value of the ALT attribute as an
- alternative to processing the image resource indicated by the SRC
- attribute.
-
- NOTE - Some HTML user agents can process graphics linked via
- anchors, but not <IMG> graphics. If a graphic is essential, it
- should be referenced from an <A> element rather than an <IMG>
- element. If the graphic is not essential, then the <IMG> element
- is appropriate.
-
- Attributes of the <IMG> element:
-
- ALIGN
- alignment of the image with respect to the text
- baseline.
-
- * `TOP' specifies that the top of the image aligns
- with the tallest item on the line containing the
- image.
-
- * `MIDDLE' specifies that the center of the image
- aligns with the baseline of the line containing the
- image.
-
- * `BOTTOM' specifies that the bottom of the image
- aligns with the baseline of the line containing the
- image.
-
- ALT
- text to use in place of the referenced image resource,
- for example due to processing constraints or user
- preference.
-
- ISMAP
- indicates an image map (see 7.6, "Image Maps").
-
- SRC
- specifies the URI of the image resource.
-
- NOTE - In practice, the media types of image
- resources are limited to a few raster graphic
- formats: typically `image/gif', `image/jpeg'. In
- particular, `text/html' resources are not
- intended to be used as image resources.
-
- Examples of use:
-
- <IMG SRC="triangle.xbm" ALT="Warning:"> Be sure
- to read these instructions.
-
- <a href="http://machine/htbin/imagemap/sample">
- <IMG SRC="sample.xbm" ISMAP>
- </a>
-
- 7. Hyperlinks
-
- In addition to general purpose elements such as paragraphs and lists,
- HTML documents can express hyperlinks. An HTML user agent allows the
- user to navigate these hyperlinks.
-
-
- A hyperlink is a relationship between two anchors, called the head
- and the tail of the hyperlink[DEXTER]. Anchors are identified by an
- anchor address: an absolute Uniform Resource Identifier (URI),
- optionally followed by a '#' and a sequence of characters called a
- fragment identifier. For example:
-
- http://www.w3.org/hypertext/WWW/TheProject.html
- http://www.w3.org/hypertext/WWW/TheProject.html#z31
-
- In an anchor address, the URI refers to a resource; it may be used in
- a variety of information retrieval protocols to obtain an entity that
- represents the resource, such as an HTML document. The fragment
- identifier, if present, refers to some view on, or portion of the
- resource.
-
- Each of the following markup constructs indicates the tail anchor of
- a hyperlink or set of hyperlinks:
-
- * <A> elements with HREF present.
-
- * <LINK> elements.
-
- * <IMG> elements.
-
- * <INPUT> elements with the SRC attribute present.
-
- * <ISINDEX> elements.
-
- * <FORM> elements with `METHOD=GET'.
-
- These markup constructs refer to head anchors by a URI, either
- absolute or relative, or a fragment identifier, or both.
-
- In the case of a relative URI, the absolute URI in the address of the
- head anchor is the result of combining the relative URI with a base
- absolute URI as in [RELURL]. The base document is taken from the
- document's <BASE> element, if present; else, it is determined as in
- [RELURL].
-
- 8. Forms
-
- A form is a template for a form data set and an associated
- method and action URI. A form data set is a sequence of
- name/value pair fields. The names are specified on the NAME
- attributes of form input elements, and the values are given
- initial values by various forms of markup and edited by the
- user. The resulting form data set is used to access an
- information service as a function of the action and method.
-
- Forms elements can be mixed in with document structuring
- elements. For example, a <PRE> element may contain a <FORM>
- element, or a <FORM> element may contain lists which contain
- <INPUT> elements. This gives considerable flexibility in
- designing the layout of forms.
-
- Form processing is a level 2 feature.
-
- 8.1. Form Elements
-
- 8.1.1. Form: FORM
-
- The <FORM> element contains a sequence of input elements, along
- with document structuring elements. The attributes are:
-
- ACTION
- specifies the action URI for the form. The action URI of
- a form defaults to the base URI of the document (see 7,
- "Hyperlinks").
-
- METHOD
- selects a method of accessing the action URI. The set of
- applicable methods is a function of the scheme of the
- action URI of the form. See 8.2.2, "Query Forms:
- METHOD=GET" and 8.2.3, "Forms with Side-Effects:
- METHOD=POST".
-
- ENCTYPE
- specifies the media type used to encode the name/value
- pairs for transport, in case the protocol does not
- itself impose a format. See 8.2.1, "The form-urlencoded
- Media Type".
-
- 8.1.2. Input Field: INPUT
-
- The <INPUT> element represents a field for user input. The TYPE
- attribute discriminates between several variations of fields.
-
-
- The <INPUT> element has a number of attributes. The set of applicable
- attributes depends on the value of the TYPE attribute.
-
- 8.1.2.1. Text Field: INPUT TYPE=TEXT
-
- The default value of the TYPE attribute is `TEXT', indicating a
- single line text entry field. (Use the <TEXTAREA> element for multi-
- line text fields.)
-
- Required attributes are:
-
- NAME
- name for the form field corresponding to this element.
-
- The optional attributes are:
-
- MAXLENGTH
- constrains the number of characters that can be entered
- into a text input field. If the value of MAXLENGTH is
- greater the the value of the SIZE attribute, the field
- should scroll appropriately. The default number of
- characters is unlimited.
-
- SIZE
- specifies the amount of display space allocated to this
- input field according to its type. The default depends
- on the user agent.
-
- VALUE
- The initial value of the field.
-
- For example:
-
- <p>Street Address: <input name=street><br>
- Postal City code: <input name=city size=16 maxlength=16><br>
- Zip Code: <input name=zip size=10 maxlength=10 value="99999-9999"><br>
-
- 8.1.2.2. Password Field: INPUT TYPE=PASSWORD
-
- An <INPUT> element with `TYPE=PASSWORD' is a text field as above,
- except that the value is obscured as it is entered. (see also: 10,
- "Security Considerations").
-
- For example:
-
- <p>Name: <input name=login> Password: <input type=password name=passwd>
-
-
-
- 8.1.2.3. Check Box: INPUT TYPE=CHECKBOX
-
- An <INPUT> element with `TYPE=CHECKBOX' represents a boolean choice.
- A set of such elements with the same name represents an n-of-many
- choice field. Required attributes are:
-
- NAME
- symbolic name for the form field corresponding to this
- element or group of elements.
-
- VALUE
- The portion of the value of the field contributed by
- this element.
-
- Optional attributes are:
-
- CHECKED
- indicates that the initial state is on.
-
- For example:
-
- <p>What flavors do you like?
- <input type=checkbox name=flavor value=vanilla>Vanilla<br>
- <input type=checkbox name=flavor value=strawberry>Strawberry<br>
- <input type=checkbox name=flavor value=chocolate checked>Chocolate<br>
-
- 8.1.2.4. Radio Button: INPUT TYPE=RADIO
-
- An <INPUT> element with `TYPE=RADIO' represents a boolean choice. A
- set of such elements with the same name represents a 1-of-many choice
- field. The NAME and VALUE attributes are required as for check boxes.
- Optional attributes are:
-
- CHECKED
- indicates that the initial state is on.
- At all times, exactly one of the radio buttons in a set is checked.
- If none of the <INPUT> elements of a set of radio buttons specifies
- `CHECKED', then the user agent must check the first radio button of
- the set initially.
-
- For example:
-
- <p>Which is your favorite?
- <input type=radio name=flavor value=vanilla>Vanilla<br>
- <input type=radio name=flavor value=strawberry>Strawberry<br>
- <input type=radio name=flavor value=chocolate>Chocolate<br>
-
-
-
- 8.1.2.5. Image Pixel: INPUT TYPE=IMAGE
-
- An <INPUT> element with `TYPE=IMAGE' specifies an image resource to
- display, and allows input of two form fields: the x and y coordinate
- of a pixel chosen from the image. The names of the fields are the
- name of the field with `.x' and `.y' appended. `TYPE=IMAGE' implies
- `TYPE=SUBMIT' processing; that is, when a pixel is chosen, the form
- as a whole is submitted.
-
- The NAME attribute is required as for other input fields. The SRC
- attribute is required and the ALIGN is optional as for the <IMG>
- element (see 5.10, "Image: IMG").
-
- For example:
-
- <p>Choose a point on the map:
- <input type=image name=point src="map.gif">
-
- 8.1.2.6. Hidden Field: INPUT TYPE=HIDDEN
-
- An <INPUT> element with `TYPE=HIDDEN' represents a hidden field.The
- user does not interact with this field; instead, the VALUE attribute
- specifies the value of the field. The NAME and VALUE attributes are
- required.
-
- For example:
-
- <input type=hidden name=context value="l2k3j4l2k3j4l2k3j4lk23">
-
- 8.1.2.7. Submit Button: INPUT TYPE=SUBMIT
-
- An <INPUT> element with `TYPE=SUBMIT' represents an input option,
- typically a button, that instructs the user agent to submit the form.
- Optional attributes are:
-
- NAME
- indicates that this element contributes a form field
- whose value is given by the VALUE attribute. If the NAME
- attribute is not present, this element does not
- contribute a form field.
-
- VALUE
- indicates a label for the input (button).
-
- You may submit this request internally:
- <input type=submit name=recipient value=internal><br>
- or to the external world:
- <input type=submit name=recipient value=world>
-
- 8.1.2.8. Reset Button: INPUT TYPE=RESET
-
- An <INPUT> element with `TYPE=RESET' represents an input option,
- typically a button, that instructs the user agent to reset the form's
- fields to their initial states. The VALUE attribute, if present,
- indicates a label for the input (button).
-
- When you are finished, you may submit this request:
- <input type=submit><br>
- You may clear the form and start over at any time: <input type=reset>
-
- 8.1.3. Selection: SELECT
-
- The <SELECT> element constrains the form field to an enumerated list
- of values. The values are given in <OPTION> elements. Attributes
- are:
-
- MULTIPLE
- indicates that more than one option may be included in
- the value.
-
- NAME
- specifies the name of the form field.
-
- SIZE
- specifies the number of visible items. Select fields of
- size one are typically pop-down menus, whereas select
- fields with size greater than one are typically lists.
-
- For example:
-
- <SELECT NAME="flavor">
- <OPTION>Vanilla
- <OPTION>Strawberry
- <OPTION value="RumRasin">Rum and Raisin
- <OPTION selected>Peach and Orange
- </SELECT>
-
- The initial state has the first option selected, unless a SELECTED
- attribute is present on any of the <OPTION> elements.
-
- 8.1.3.1. Option: OPTION
-
- The Option element can only occur within a Select element. It
- represents one choice, and has the following attributes:
-
- SELECTED
- Indicates that this option is initially selected.
-
- VALUE
- indicates the value to be returned if this option is
- chosen. The field value defaults to the content of the
- <OPTION> element.
-
- The content of the <OPTION> element is presented to the user to
- represent the option. It is used as a returned value if the VALUE
- attribute is not present.
-
- 8.1.4. Text Area: TEXTAREA
-
- The <TEXTAREA> element represents a multi-line text field.
- Attributes are:
-
- COLS
- the number of visible columns to display for the text
- area, in characters.
-
- NAME
- Specifies the name of the form field.
-
- ROWS
- The number of visible rows to display for the text area,
- in characters.
-
- For example:
-
- <TEXTAREA NAME="address" ROWS=6 COLS=64>
- HaL Computer Systems
- 1315 Dell Avenue
- Campbell, California 95008
- </TEXTAREA>
-
- The content of the <TEXTAREA> element is the field's initial value.
-
- Typically, the ROWS and COLS attributes determine the visible
- dimension of the field in characters. The field is typically rendered
- in a fixed-width font. HTML user agents should allow text to extend
- beyond these limits by scrolling as needed.
-